package com.copa.module.cart.mapper;

import com.copa.module.cart.domain.dto.CartListDto;
import com.copa.module.cart.domain.entity.CartEntity;
import com.copa.module.cart.domain.vo.CartAddVo;
import org.apache.ibatis.annotations.Mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author copa
 * @createDate 2021-01-18
 * @function t_cart表 Mapper 接口
 */
@Mapper
public interface CartDao extends BaseMapper<CartEntity> {

    List<CartListDto> listByUserId(@Param("userId") Long userId);

    CartEntity findByCartIdAndUserId(@Param("id") Long id, @Param("userId") Long userId);

    CartEntity findOneCart(@Param("cartAddVo") CartAddVo cartAddVo, @Param("userId") Long userId);

    Integer deleteByIds(@Param("cartIds") List<Long> cartIds, @Param("userId") Long userId);

    List<CartEntity> findList(@Param("userId") Long userId, @Param("cartIds") List<Long> cartIds);

    List<CartListDto> listNotSaleByUserId(@Param("userId") Long userId);
}
